Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add item scope to java #2674

Merged
merged 5 commits into from
Jan 14, 2025
Merged

Add item scope to java #2674

merged 5 commits into from
Jan 14, 2025

Conversation

AndreasArvidsson
Copy link
Member

@AndreasArvidsson AndreasArvidsson commented Nov 9, 2024

int[] values = {1, 2, 3};

This example is problematic. Currently we test the language specific implementation before the text based one. This means that if your cursor is inside the curly brackets item is values = {1, 2, 3}. I don't think this can be solved until we have a better oneOf implementation of collection item.
Same problem with JS #2675

Checklist

  • I have added tests
  • [/] I have updated the docs and cheatsheet
  • [/] I have not broken the cheatsheet

@AndreasArvidsson AndreasArvidsson requested a review from a team as a code owner November 9, 2024 10:53
@AndreasArvidsson AndreasArvidsson mentioned this pull request Nov 9, 2024
1 task
@AndreasArvidsson AndreasArvidsson marked this pull request as draft November 9, 2024 11:19
@AndreasArvidsson AndreasArvidsson changed the title Added item scope to java Add item scope to java Nov 9, 2024
github-merge-queue bot pushed a commit that referenced this pull request Nov 18, 2024
```js
const value = [1, 2];
```
This example is problematic. Currently we test the language specific
implementation before the text based one. This means that if your cursor
is inside the curly brackets `item` is `value = [1, 2]`. I don't think
this can be solved until we have a better `oneOf` implementation of
collection item.
Same problem with Java
#2674

To fix that above I made a change so that the text based item can be
used even if there is a syntax tree one available if it's smaller. This
needs to merge before the java pr.

## Checklist

- [x] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [/] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [/] I have not broken the cheatsheet
cursorless-bot pushed a commit to hands-free-vim/cursorless.nvim that referenced this pull request Nov 18, 2024
```js
const value = [1, 2];
```
This example is problematic. Currently we test the language specific
implementation before the text based one. This means that if your cursor
is inside the curly brackets `item` is `value = [1, 2]`. I don't think
this can be solved until we have a better `oneOf` implementation of
collection item.
Same problem with Java
cursorless-dev/cursorless#2674

To fix that above I made a change so that the text based item can be
used even if there is a syntax tree one available if it's smaller. This
needs to merge before the java pr.

## Checklist

- [x] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [/] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [/] I have not broken the cheatsheet
@pokey
Copy link
Member

pokey commented Jan 7, 2025

@AndreasArvidsson just following up on this one. I'm assuming it's not waiting on anything from me?

@AndreasArvidsson
Copy link
Member Author

No I will revisit this once the new collection item has been merged

@pokey pokey added the blocked Blocked on something; eg another PR being completed. Look in comments of issue / PR for reason label Jan 7, 2025
@AndreasArvidsson AndreasArvidsson marked this pull request as ready for review January 14, 2025 06:16
@AndreasArvidsson AndreasArvidsson removed the blocked Blocked on something; eg another PR being completed. Look in comments of issue / PR for reason label Jan 14, 2025
@AndreasArvidsson AndreasArvidsson added this pull request to the merge queue Jan 14, 2025
Merged via the queue into main with commit 301b2d8 Jan 14, 2025
15 checks passed
@AndreasArvidsson AndreasArvidsson deleted the javaItem branch January 14, 2025 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants